const { tenantsModel, } = require('./models/tenantsModel');

module.exports.checktenants = async function (val) {
    const data = await tenantsModel.find(val);
    return data;
}

//更改信用值
module.exports.modifyCredits = async function (val) {

    const data = await tenantsModel.update({ _id: val.tenantsId }, { credits: val.tenantsCredits });
    return data
}

/************************练超********************************/
//租客注册
module.exports.registers = async function (val) {
    const data = await tenantsModel.create(val);
    return data;
}

//租客验证账号是否存在
module.exports.isRegisters = async isData => {
    const data = await tenantsModel.find(isData);
    return data;
}